<div class="top_menu_container">
<?php
	list($menuElement, $subMenuElement) = explode('/', $this->menuActiveElement);
?>
<ul class="top_menu">
<?
while (list ($key, $val) = each($this->userMenu))
{
    $class = '';
    if ($key == $menuElement) $class = 'active here';
       
	?><li <?=($class ? ' class="' . $class . '"' : '');?>><a href="<?=htmlspecialchars(Mozg::Router('http')->Create($val['link']));?>"><?=Mozg_Lang::_($val['title']);?></a></li><?
}
?>
</ul>
<?
reset($this->userMenu);
$is_sublist = false;
while (list ($key, $val) = each($this->userMenu))
{
    $submenu = (array)$val['submenu'];
    $addclass = '';
    if ($key != $menuElement) $addclass = ' hide';
    else $is_sublist = true;
?>
<ul class="level2<?=$addclass;?>">
<?
    while (list ($kk, $vv) = each($submenu))
    {
		?><li <?=(($key == $menuElement) && ($kk == $subMenuElement) ? ' class="active"' : '');?>><a href="<?=htmlspecialchars(Mozg::Router('http')->Create($vv['link']));?>"><?=Mozg_Lang::_($vv['title']);?></a></li><?
    }
?>
</ul>
<?
}
if (! $is_sublist)
{
	?><ul class="level2"></ul><?
}
?>
<div class="clr"><!--x--></div>
</div>